package mobi.hami.huapin.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;

/**
 *  网站基础配置
 *
 * @author 阿飞 jijunjian@hami.mobi
 * @date 2018/8/25 15:05
 */
@Component
public class AppConfig {

    /**
     * 首页默认商品数量
     */
    @Value("${app.defaultfoodcount}")
    public  int defaultfoodcount;
    @Value("${defaultAddressId}")
    private String defaultAddressId;

    public Integer getDefaultAddressId(){
        if(defaultAddressId==null || defaultAddressId.isEmpty()){
            return 14;
        }
        return  Integer.parseInt(defaultAddressId);
    }

}
